package bb.lanxing.model.json;

import android.os.Parcel;
import android.os.Parcelable;
import com.alibaba.fastjson.annotation.JSONField;

public class WorkoutLap implements Parcelable {
    public static final Parcelable.Creator<WorkoutLap> CREATOR = new Parcelable.Creator<WorkoutLap>() {
        @Override
        public WorkoutLap createFromParcel(Parcel parcel) {
            return new WorkoutLap(parcel);
        }

        @Override
        public WorkoutLap[] newArray(int i) {
            return new WorkoutLap[i];
        }
    };
    private long duration;
    private int end;
    private int id;
    @JSONField(name = "loop_index")
    private int index;
    @JSONField(name = "is_best")
    private boolean isBest;
    private double similarity;
    @JSONField(name = "avs")
    private float speed;
    private int start;

    @Override
    public int describeContents() {
        return 0;
    }

    public WorkoutLap() {
    }

    public int getId() {
        return this.id;
    }

    public void setId(int i) {
        this.id = i;
    }

    public int getStart() {
        return this.start;
    }

    public void setStart(int i) {
        this.start = i;
    }

    public int getEnd() {
        return this.end;
    }

    public void setEnd(int i) {
        this.end = i;
    }

    public double getSimilarity() {
        return this.similarity;
    }

    public void setSimilarity(double d) {
        this.similarity = d;
    }

    public boolean isBest() {
        return this.isBest;
    }

    public void setBest(boolean z) {
        this.isBest = z;
    }

    public int getIndex() {
        return this.index;
    }

    public void setIndex(int i) {
        this.index = i;
    }

    public long getDuration() {
        return this.duration;
    }

    public void setDuration(long j) {
        this.duration = j;
    }

    public float getSpeed() {
        return this.speed;
    }

    public void setSpeed(float f) {
        this.speed = f;
    }

    @Override
    public void writeToParcel(Parcel parcel, int i) {
        parcel.writeInt(this.id);
        parcel.writeInt(this.index);
        parcel.writeLong(this.duration);
        parcel.writeFloat(this.speed);
        parcel.writeInt(this.start);
        parcel.writeInt(this.end);
        parcel.writeDouble(this.similarity);
        parcel.writeByte(this.isBest ? (byte) 1 : (byte) 0);
    }

    protected WorkoutLap(Parcel parcel) {
        this.id = parcel.readInt();
        this.index = parcel.readInt();
        this.duration = parcel.readLong();
        this.speed = parcel.readFloat();
        this.start = parcel.readInt();
        this.end = parcel.readInt();
        this.similarity = parcel.readDouble();
        this.isBest = parcel.readByte() != 0;
    }
}
